.class public Lcn/cheln/explorer/ds/database/a/a;
.super Ljava/lang/Object;


# direct methods
.method public constructor <init>()V
    .locals 0

    invoke-direct {p0}, Ljava/lang/Object;-><init>()V

    return-void
.end method

.method public static a(Lcn/cheln/explorer/beans/FileInfo;Lcn/cheln/explorer/beans/FileInfo;Lcom/direction/hold/ui/CommonActivity;)V
    .locals 9

    const/4 v8, 0x1

    const/4 v2, 0x0

    invoke-virtual {p0}, Lcn/cheln/explorer/beans/FileInfo;->c()Ljava/lang/Boolean;

    move-result-object v0

    invoke-virtual {v0}, Ljava/lang/Boolean;->booleanValue()Z

    move-result v0

    if-eqz v0, :cond_4

    invoke-virtual {p0}, Lcn/cheln/explorer/beans/FileInfo;->c()Ljava/lang/Boolean;

    move-result-object v0

    invoke-virtual {v0}, Ljava/lang/Boolean;->booleanValue()Z

    move-result v0

    if-eqz v0, :cond_0

    invoke-virtual {p0}, Lcn/cheln/explorer/beans/FileInfo;->p()Ljava/io/File;

    move-result-object v0

    invoke-virtual {v0}, Ljava/io/File;->listFiles()[Ljava/io/File;

    move-result-object v0

    if-nez v0, :cond_1

    invoke-static {p0, p2}, Lcn/cheln/explorer/ds/database/a/a;->a(Lcn/cheln/explorer/beans/FileInfo;Lcom/direction/hold/ui/CommonActivity;)V

    :cond_0
    :goto_0
    return-void

    :cond_1
    iget-object v1, p2, Lcom/direction/hold/ui/CommonActivity;->f:Landroid/app/ProgressDialog;

    invoke-virtual {v1}, Landroid/app/ProgressDialog;->isShowing()Z

    move-result v1

    if-eqz v1, :cond_3

    array-length v1, v0

    :goto_1
    if-ge v2, v1, :cond_2

    aget-object v3, v0, v2

    new-instance v4, Lcn/cheln/explorer/beans/FileInfo;

    invoke-direct {v4, v3, p2}, Lcn/cheln/explorer/beans/FileInfo;-><init>(Ljava/io/File;Landroid/content/Context;)V

    new-instance v5, Lcn/cheln/explorer/beans/FileInfo;

    new-instance v6, Ljava/lang/StringBuilder;

    invoke-direct {v6}, Ljava/lang/StringBuilder;-><init>()V

    invoke-virtual {p1}, Lcn/cheln/explorer/beans/FileInfo;->g()Ljava/lang/String;

    move-result-object v7

    invoke-virtual {v6, v7}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v6

    const-string v7, "/"

    invoke-virtual {v6, v7}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v6

    invoke-virtual {v3}, Ljava/io/File;->getName()Ljava/lang/String;

    move-result-object v3

    invoke-virtual {v6, v3}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v3

    invoke-virtual {v3}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;

    move-result-object v3

    invoke-direct {v5, v3}, Lcn/cheln/explorer/beans/FileInfo;-><init>(Ljava/lang/String;)V

    invoke-static {v4, v5, p2, v8}, Lcn/cheln/explorer/ds/database/a/a;->a(Lcn/cheln/explorer/beans/FileInfo;Lcn/cheln/explorer/beans/FileInfo;Lcom/direction/hold/ui/CommonActivity;Z)V

    add-int/lit8 v2, v2, 0x1

    goto :goto_1

    :cond_2
    invoke-static {p0, p1, p2, v8}, Lcn/cheln/explorer/ds/database/a/a;->b(Lcn/cheln/explorer/beans/FileInfo;Lcn/cheln/explorer/beans/FileInfo;Lcom/direction/hold/ui/CommonActivity;Z)V

    goto :goto_0

    :cond_3
    iget-object v1, p2, Lcom/direction/hold/ui/CommonActivity;->f:Landroid/app/ProgressDialog;

    invoke-virtual {v1}, Landroid/app/ProgressDialog;->show()V

    new-instance v1, Lcn/cheln/explorer/ds/database/a/c;

    invoke-direct {v1, v0, p2, p1, p0}, Lcn/cheln/explorer/ds/database/a/c;-><init>([Ljava/io/File;Lcom/direction/hold/ui/CommonActivity;Lcn/cheln/explorer/beans/FileInfo;Lcn/cheln/explorer/beans/FileInfo;)V

    invoke-virtual {v1}, Lcn/cheln/explorer/ds/database/a/c;->start()V

    goto :goto_0

    :cond_4
    invoke-static {p0, p1, p2, v2}, Lcn/cheln/explorer/ds/database/a/a;->b(Lcn/cheln/explorer/beans/FileInfo;Lcn/cheln/explorer/beans/FileInfo;Lcom/direction/hold/ui/CommonActivity;Z)V

    goto :goto_0
.end method

.method public static a(Lcn/cheln/explorer/beans/FileInfo;Lcn/cheln/explorer/beans/FileInfo;Lcom/direction/hold/ui/CommonActivity;Z)V
    .locals 8

    const/4 v2, 0x0

    invoke-virtual {p0}, Lcn/cheln/explorer/beans/FileInfo;->c()Ljava/lang/Boolean;

    move-result-object v0

    invoke-virtual {v0}, Ljava/lang/Boolean;->booleanValue()Z

    move-result v0

    if-eqz v0, :cond_3

    invoke-virtual {p0}, Lcn/cheln/explorer/beans/FileInfo;->p()Ljava/io/File;

    move-result-object v0

    invoke-virtual {v0}, Ljava/io/File;->listFiles()[Ljava/io/File;

    move-result-object v0

    if-nez v0, :cond_1

    if-nez p3, :cond_0

    invoke-static {p0, p2}, Lcn/cheln/explorer/ds/database/a/a;->a(Lcn/cheln/explorer/beans/FileInfo;Lcom/direction/hold/ui/CommonActivity;)V

    :cond_0
    :goto_0
    return-void

    :cond_1
    array-length v1, v0

    :goto_1
    if-ge v2, v1, :cond_2

    aget-object v3, v0, v2

    new-instance v4, Lcn/cheln/explorer/beans/FileInfo;

    invoke-direct {v4, v3, p2}, Lcn/cheln/explorer/beans/FileInfo;-><init>(Ljava/io/File;Landroid/content/Context;)V

    new-instance v5, Lcn/cheln/explorer/beans/FileInfo;

    new-instance v6, Ljava/lang/StringBuilder;

    invoke-direct {v6}, Ljava/lang/StringBuilder;-><init>()V

    invoke-virtual {p1}, Lcn/cheln/explorer/beans/FileInfo;->g()Ljava/lang/String;

    move-result-object v7

    invoke-virtual {v6, v7}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v6

    const-string v7, "/"

    invoke-virtual {v6, v7}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v6

    invoke-virtual {v3}, Ljava/io/File;->getName()Ljava/lang/String;

    move-result-object v7

    invoke-virtual {v6, v7}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v6

    invoke-virtual {v6}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;

    move-result-object v6

    invoke-direct {v5, v6}, Lcn/cheln/explorer/beans/FileInfo;-><init>(Ljava/lang/String;)V

    invoke-virtual {v3}, Ljava/io/File;->isDirectory()Z

    move-result v3

    invoke-static {v4, v5, p2, v3}, Lcn/cheln/explorer/ds/database/a/a;->a(Lcn/cheln/explorer/beans/FileInfo;Lcn/cheln/explorer/beans/FileInfo;Lcom/direction/hold/ui/CommonActivity;Z)V

    add-int/lit8 v2, v2, 0x1

    goto :goto_1

    :cond_2
    const/4 v0, 0x1

    invoke-static {p0, p1, p2, v0}, Lcn/cheln/explorer/ds/database/a/a;->b(Lcn/cheln/explorer/beans/FileInfo;Lcn/cheln/explorer/beans/FileInfo;Lcom/direction/hold/ui/CommonActivity;Z)V

    goto :goto_0

    :cond_3
    invoke-static {p0, p1, p2, v2}, Lcn/cheln/explorer/ds/database/a/a;->b(Lcn/cheln/explorer/beans/FileInfo;Lcn/cheln/explorer/beans/FileInfo;Lcom/direction/hold/ui/CommonActivity;Z)V

    goto :goto_0
.end method

.method private static a(Lcn/cheln/explorer/beans/FileInfo;Lcom/direction/hold/ui/CommonActivity;)V
    .locals 2

    new-instance v0, Ljava/lang/Thread;

    new-instance v1, Lcn/cheln/explorer/ds/database/a/b;

    invoke-direct {v1, p1, p0}, Lcn/cheln/explorer/ds/database/a/b;-><init>(Lcom/direction/hold/ui/CommonActivity;Lcn/cheln/explorer/beans/FileInfo;)V

    invoke-direct {v0, v1}, Ljava/lang/Thread;-><init>(Ljava/lang/Runnable;)V

    invoke-virtual {v0}, Ljava/lang/Thread;->start()V

    return-void
.end method

.method public static b(Lcn/cheln/explorer/beans/FileInfo;Lcn/cheln/explorer/beans/FileInfo;Lcom/direction/hold/ui/CommonActivity;Z)V
    .locals 9

    const/4 v6, 0x1

    const/4 v5, 0x0

    const-string v8, "_data like ?"

    const-string v7, ""

    const-string v4, " "

    invoke-static {p0}, Lcn/cheln/support/images/f;->a(Lcn/cheln/explorer/beans/FileInfo;)Lcn/cheln/support/images/f;

    move-result-object v0

    if-eqz p3, :cond_1

    sget-object v1, Lcn/cheln/explorer/ds/a;->d:Landroid/net/Uri;

    invoke-static {p0, v0}, Lcn/cheln/explorer/ds/b/a;->a(Lcn/cheln/explorer/beans/FileInfo;Lcn/cheln/support/images/f;)Landroid/content/ContentValues;

    move-result-object v0

    invoke-virtual {p2}, Lcom/direction/hold/ui/CommonActivity;->getContentResolver()Landroid/content/ContentResolver;

    move-result-object v2

    const-string v3, "_data like ?"

    new-array v3, v6, [Ljava/lang/String;

    invoke-virtual {p1}, Lcn/cheln/explorer/beans/FileInfo;->g()Ljava/lang/String;

    move-result-object v4

    aput-object v4, v3, v5

    invoke-virtual {v2, v1, v0, v8, v3}, Landroid/content/ContentResolver;->update(Landroid/net/Uri;Landroid/content/ContentValues;Ljava/lang/String;[Ljava/lang/String;)I

    :cond_0
    :goto_0
    return-void

    :cond_1
    invoke-virtual {p0}, Lcn/cheln/explorer/beans/FileInfo;->n()V

    invoke-virtual {p1}, Lcn/cheln/explorer/beans/FileInfo;->n()V

    invoke-static {p1}, Lcn/cheln/support/images/f;->a(Lcn/cheln/explorer/beans/FileInfo;)Lcn/cheln/support/images/f;

    move-result-object v1

    iget-object v2, v1, Lcn/cheln/support/images/f;->f:Ljava/lang/String;

    iget-object v3, v0, Lcn/cheln/support/images/f;->f:Ljava/lang/String;

    invoke-virtual {v2, v3}, Ljava/lang/String;->equalsIgnoreCase(Ljava/lang/String;)Z

    move-result v2

    if-eqz v2, :cond_3

    iget-object v1, v0, Lcn/cheln/support/images/f;->h:Landroid/net/Uri;

    iget-object v2, v0, Lcn/cheln/support/images/f;->h:Landroid/net/Uri;

    if-eqz v2, :cond_2

    invoke-static {p0, v0}, Lcn/cheln/explorer/ds/b/a;->a(Lcn/cheln/explorer/beans/FileInfo;Lcn/cheln/support/images/f;)Landroid/content/ContentValues;

    move-result-object v0

    invoke-virtual {p2}, Lcom/direction/hold/ui/CommonActivity;->getContentResolver()Landroid/content/ContentResolver;

    move-result-object v2

    const-string v3, "_data like ?"

    new-array v3, v6, [Ljava/lang/String;

    invoke-virtual {p1}, Lcn/cheln/explorer/beans/FileInfo;->g()Ljava/lang/String;

    move-result-object v4

    aput-object v4, v3, v5

    invoke-virtual {v2, v1, v0, v8, v3}, Landroid/content/ContentResolver;->update(Landroid/net/Uri;Landroid/content/ContentValues;Ljava/lang/String;[Ljava/lang/String;)I

    :cond_2
    new-instance v0, Landroid/os/Message;

    invoke-direct {v0}, Landroid/os/Message;-><init>()V

    const/4 v1, 0x5

    iput v1, v0, Landroid/os/Message;->what:I

    iget-object v1, p2, Lcom/direction/hold/ui/CommonActivity;->i:Landroid/os/Handler;

    invoke-virtual {v1, v0}, Landroid/os/Handler;->sendMessage(Landroid/os/Message;)Z

    goto :goto_0

    :cond_3
    sget-object v2, Lcn/cheln/explorer/ds/database/c;->a:Ljava/util/Map;

    iget-object v3, v1, Lcn/cheln/support/images/f;->g:Ljava/lang/String;

    invoke-interface {v2, v3}, Ljava/util/Map;->containsKey(Ljava/lang/Object;)Z

    move-result v2

    if-eqz v2, :cond_4

    const-string v2, ""

    new-instance v2, Ljava/lang/StringBuilder;

    const-string v3, "mimePrefix -------------> remove "

    invoke-direct {v2, v3}, Ljava/lang/StringBuilder;-><init>(Ljava/lang/String;)V

    iget-object v3, v1, Lcn/cheln/support/images/f;->e:Ljava/lang/String;

    invoke-virtual {v2, v3}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v2

    const-string v3, " "

    invoke-virtual {v2, v4}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v2

    iget-object v1, v1, Lcn/cheln/support/images/f;->g:Ljava/lang/String;

    invoke-virtual {v2, v1}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v1

    invoke-virtual {v1}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;

    move-result-object v1

    invoke-static {v7, v1}, Lcn/cheln/support/app/c;->a(Ljava/lang/String;Ljava/lang/String;)V

    iget-object v1, v0, Lcn/cheln/support/images/f;->h:Landroid/net/Uri;

    invoke-static {p1, p2}, Lcn/cheln/support/app/a;->a(Lcn/cheln/explorer/beans/FileInfo;Landroid/content/Context;)V

    :cond_4
    sget-object v1, Lcn/cheln/explorer/ds/database/c;->a:Ljava/util/Map;

    iget-object v2, v0, Lcn/cheln/support/images/f;->g:Ljava/lang/String;

    invoke-interface {v1, v2}, Ljava/util/Map;->containsKey(Ljava/lang/Object;)Z

    move-result v1

    if-eqz v1, :cond_0

    const-string v1, ""

    new-instance v1, Ljava/lang/StringBuilder;

    const-string v2, "mimePrefix -------------> add "

    invoke-direct {v1, v2}, Ljava/lang/StringBuilder;-><init>(Ljava/lang/String;)V

    iget-object v2, v0, Lcn/cheln/support/images/f;->e:Ljava/lang/String;

    invoke-virtual {v1, v2}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v1

    const-string v2, " "

    invoke-virtual {v1, v4}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v1

    iget-object v2, v0, Lcn/cheln/support/images/f;->h:Landroid/net/Uri;

    invoke-virtual {v1, v2}, Ljava/lang/StringBuilder;->append(Ljava/lang/Object;)Ljava/lang/StringBuilder;

    move-result-object v1

    const-string v2, " "

    invoke-virtual {v1, v4}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v1

    iget-object v2, v0, Lcn/cheln/support/images/f;->g:Ljava/lang/String;

    invoke-virtual {v1, v2}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v1

    invoke-virtual {v1}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;

    move-result-object v1

    invoke-static {v7, v1}, Lcn/cheln/support/app/c;->a(Ljava/lang/String;Ljava/lang/String;)V

    invoke-static {p0, v0}, Lcn/cheln/explorer/ds/b/a;->a(Lcn/cheln/explorer/beans/FileInfo;Lcn/cheln/support/images/f;)Landroid/content/ContentValues;

    move-result-object v1

    invoke-virtual {p2}, Lcom/direction/hold/ui/CommonActivity;->getContentResolver()Landroid/content/ContentResolver;

    move-result-object v2

    iget-object v0, v0, Lcn/cheln/support/images/f;->h:Landroid/net/Uri;

    invoke-virtual {v2, v0, v1}, Landroid/content/ContentResolver;->insert(Landroid/net/Uri;Landroid/content/ContentValues;)Landroid/net/Uri;

    goto/16 :goto_0
.end method
